import Cookies from 'js-cookie'

const TokenKey = 'vue_hrscss_token'
const timeKey = 'vue_timestamp'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
// 为了后面主动介入token失效,这里需要定义一个存储时间戳的方法
export function setTimeStamp() {
  return Cookies.set(timeKey, Date.now())
}
export function getTimeStamp() {
  return Cookies.get(timeKey)
}
